
<?php
     header("Content-Type: text/html; charset=utf-8");

     $conn =  new mysqli('localhost','root','root','sy2003');
     if($conn->connect_error){
        //  判断连接数据库成没成
        die('连接失败' . $conn->connect_error);
    }


    $start = $_GET['start'];
    $size = $_GET['size'];

    mysqli_query($conn,"set names utf8"); 
    // 执行sql语句
    $res = $conn->query("SELECT * FROM `listthree` LIMIT $start,$size");
    // echo "SELECT * FROM `listthree` LIMIT $start,$size";
    // 这个数组arr 用来存 所有的数据
    $arr = array();
    while($row = mysqli_fetch_assoc($res)){
        $arr[] = $row;
    }
    echo json_encode($arr);
?>